<@override name="content">

<div class="pagination pagination-centered">
  <#include "../common/_paginate.html" />
  <@paginate currentPage=logs.pageNumber totalPage=logs.totalPage actionUrl="user/loginlog/" />
  <div class="pull-right">
    <span class="badge badge-info">${logs.pageNumber}/${logs.totalPage} Pages</span>
    <span class="badge badge-info">${logs.totalRow} Records</span>
  </div>
</div>

<table id="user-log" class="table table-hover table-condensed">
  <thead>
  <tr>
    <th>No.</th>
    <th>Uid</th>
    <th>Name</th>
    <th>IP</th>
    <th>Time</th>
    <th>Success</th>
  </tr>
  </thead>
  <tbody>
    <#if logs??>
      <#list logs.list as log>
      <tr>
        <td>${(logs.pageNumber-1) * logs.pageSize + log_index + 1}</td>
        <td>${log.uid!0}</td>
        <td>${log.name!}</td>
        <td>${log.ip!}</td>
        <td class="timestamp" data="${log.ctime}"></td>
        <td>${log.success?string('<span class="label label-success">Y</span>', '<span class="label label-important">N</span>')}</td>
      </tr>
      </#list>
    </#if>
  </tbody>
</table>
</@override>

<@override name="scripts">
  <#if oj_style != "slate">
  <link rel="stylesheet" href="assets/tablecloth/css/tablecloth.css" type="text/css">
  <script src="assets/tablecloth/js/jquery.metadata.js"></script>
  <script src="assets/tablecloth/js/jquery.tablecloth.js"></script>
  </#if>

<script type="text/javascript">
  $(document).ready(function () {
    $('.timestamp').each(function () {
      $(this).html(getLocalTime($(this).attr('data')));
    });

    <#if oj_style != "slate">
      $("#user-log").tablecloth({
        theme: "stats",
        condensed: true,
        sortable: false,
        striped: true,
        clean: true
      });
    </#if>
  });
</script>
</@override>
<@extends name="../common/_layout.html" />
